#include <iostream>
#include <string>
using namespace std;
// 老师类
class Teacher {
public:
    Teacher(const std::string& name, int age) : name_(name), age_(age) {}
 
    void teach() {
        std::cout << name_ << " is teaching." << std::endl;
    }
    virtual void Print()
    {
        cout << name_ << age_ << endl;
    }
protected:
    std::string name_;
    int age_;
};
 
// 学生类
class Student {
public:
    Student(const std::string& name, int id) : name_(name), id_(id) {}
 
    void study() {
        std::cout << name_ << " is studying." << std::endl;
    }
    virtual void Print()
    {
        cout << name_ << id_ << endl;
    }
protected:
    std::string name_;
    int id_;
};
 
// 研究生类
class Graduate : public Teacher, public Student {
public:
    Graduate(const std::string& name, int age, int id) : Teacher(name, age), Student(name, id) {}
 
    void teach() {
        Teacher::teach();
    }
 
    void study() {
        Student::study();
    }
    virtual void Print()
    {
        // Teacher::Print();
        // Student::Print();
        // cout << name_ 
    }
};

int main() {
    Teacher teacher("Mr. Wang", 40);
    teacher.teach();
    teacher.Print();
    
    
    Student student("Li Lei", 123456);
    student.study();
    student.Print();

 
    Graduate graduate("Zhang San", 25, 789012);
    graduate.teach();
    graduate.study();
    graduate.Print();
    return 0;
}